﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Infragistics.WebUI.UltraWebListbar;

public partial class index_scwd : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (_Customer.Competences.IsOwnedCompetences(Competences.Administrator) || _Customer.CustomerTypeID == 0)
        {
            SiteParentItem();   //总商城菜单

            if (!_Customer.Competences.IsOwnedCompetences(Competences.BuildCompetencesList(Competences.FillContent))) //填充网站内容的权限
            {
                PublicFunction.GoError(ErrorNumber.NotEnoughCompetence, "对不起，您没有足够的权限访问此页面", "PageBase");
                return;
            }
        }
        else
        {
            SiteChildItem();    //子商城菜单，已激活会员的菜单
            
            if (!_Customer.Competences.IsOwnedCompetences(Competences.BuildCompetencesList(Competences.SurrogateR)))  //代理商注册会员的权限
            {
                PublicFunction.GoError(ErrorNumber.NotEnoughCompetence, "对不起，您没有足够的权限访问此页面", "PageBase");
                return;
            }
        }
    }

    #region Web 窗体设计器生成的代码

    override protected void OnInit(EventArgs e)
    {
        isRequestLogin = true;                                  //是否需要登录
        RequestLoginPage = this.Request.Url.AbsoluteUri;        //获取决对Url
        isAtFramePageLogin = true;                              //是框架页

        //RequestCompetences = Competences.BuildCompetencesList(Competences.SurrogateR);//页面权限

        base.OnInit(e);
    }

    #endregion

    private void SiteParentItem()
    {
        lbModelName.Text = "商城网店"; //模块名称        

        lbMain.Groups.Clear();

        Group group_sy = new Group(" 首 页 ", "g_sy");
        setGroupStyle(group_sy);
        lbMain.Groups.Add(group_sy);
        Items items_sy = lbMain.Groups.FromKey("g_sy").Items;
        items_sy.Clear();

        items_sy.Add(new Item("最新订单", "./images/clearing/9_dian.jpg", "shop/index_scwd.aspx"));
        items_sy.Add(new Item("销量排行", "./images/clearing/9_dian.jpg", "shop/TopSales.aspx"));


        Group group_hygl = new Group("商城管理", "g_hygl");
        setGroupStyle(group_hygl);
        lbMain.Groups.Add(group_hygl);
        Items items_hygl = lbMain.Groups.FromKey("g_hygl").Items;
        items_hygl.Clear();

        items_hygl.Add(new Item("商城列表", "./images/clearing/9_dian.jpg", "shop/Shop_List.aspx"));
        items_hygl.Add(new Item("商城会员", "./images/clearing/9_dian.jpg", "shop/Member_Manager.aspx"));
        items_hygl.Add(new Item("产品PV值查询", "./images/clearing/9_dian.jpg", "shop/GoodPV_Search.aspx"));      


        Group group_ddgl = new Group("订单管理", "g_ddgl");
        setGroupStyle(group_ddgl);
        lbMain.Groups.Add(group_ddgl);
        Items items_ddgl = lbMain.Groups.FromKey("g_ddgl").Items;
        items_ddgl.Clear();

        items_ddgl.Add(new Item("确认付款", "./images/clearing/9_dian.jpg", "shop/Order_Manager.aspx?Type=Check"));
        items_ddgl.Add(new Item("订单查询", "./images/clearing/9_dian.jpg", "shop/Order_Manager.aspx?Type=Query"));
        items_ddgl.Add(new Item("订单出库", "./images/clearing/9_dian.jpg", "shop/Order_Manager.aspx?Type=Out"));


        Group group_zxgl = new Group("资讯管理", "g_zxgl");
        setGroupStyle(group_zxgl);
        lbMain.Groups.Add(group_zxgl);
        Items items_zxgl = lbMain.Groups.FromKey("g_zxgl").Items;
        items_zxgl.Clear();

        items_zxgl.Add(new Item("商品评论", "./images/clearing/9_dian.jpg", "shop/Good_Comments.aspx"));
        items_zxgl.Add(new Item("商品咨询", "./images/clearing/9_dian.jpg", "shop/Good_Advisory.aspx"));


        Group group_spgl = new Group("商品管理", "g_spgl");
        setGroupStyle(group_spgl);
        lbMain.Groups.Add(group_spgl);
        Items items_spgl = lbMain.Groups.FromKey("g_spgl").Items;
        items_spgl.Clear();

        items_spgl.Add(new Item("商品上架", "./images/clearing/9_dian.jpg", "shop/Good_Manager.aspx?Type=Info"));


        Group group_wdsz = new Group("网店设置", "g_wdsz");
        setGroupStyle(group_wdsz);
        lbMain.Groups.Add(group_wdsz);
        Items items_wdsz = lbMain.Groups.FromKey("g_wdsz").Items;
        items_wdsz.Clear();

        items_wdsz.Add(new Item("开通网店", "./images/clearing/9_dian.jpg", "shop/ShopManager.aspx")); 
        items_wdsz.Add(new Item("网店信息", "./images/clearing/9_dian.jpg", "shop/ShopSiteConfig_BaseInfo.aspx"));
        items_wdsz.Add(new Item("热点设置", "./images/clearing/9_dian.jpg", "shop/HotSpot_Manager.aspx"));
        items_wdsz.Add(new Item("商城公告", "./images/clearing/9_dian.jpg", "shop/Article_Manager.aspx?Type=SCGG"));
        //items_wdsz.Add(new Item("支付设置", "./images/clearing/9_dian.jpg", "shop/OnlinePayGateway.aspx"));
        items_wdsz.Add(new Item("在线调查", "./images/clearing/9_dian.jpg", "shop/OnlineSurvey_Manager.aspx"));
        items_wdsz.Add(new Item("关于我们", "./images/clearing/9_dian.jpg", "shop/AboutUs_Manager.aspx"));
        items_wdsz.Add(new Item("联系我们", "./images/clearing/9_dian.jpg", "shop/LinkUs_Manager.aspx"));
        items_wdsz.Add(new Item("客服中心管理", "./images/clearing/9_dian.jpg", "shop/HelpType_Manager.aspx"));
        items_wdsz.Add(new Item("客服中心信息", "./images/clearing/9_dian.jpg", "shop/HelpType_Info.aspx"));
        items_wdsz.Add(new Item("广告位管理", "./images/clearing/9_dian.jpg", "shop/TemplateFile.aspx"));
        items_wdsz.Add(new Item("支付方式", "./images/clearing/9_dian.jpg", "shop/PayType.aspx"));
        items_wdsz.Add(new Item("配送方式", "./images/clearing/9_dian.jpg", "shop/CarriageType.aspx"));
        //items_wdsz.Add(new Item("邮费管理", "./images/clearing/9_dian.jpg", "shop/Postage_Manager.aspx"));         

        //Group group_news = new Group("文章管理", "g_news");
        //setGroupStyle(group_news);
        //lbMain.Groups.Add(group_news);
        //Items items_news = lbMain.Groups.FromKey("g_news").Items;
        //items_news.Clear();

        //Type:1 商城公告 2 购物指南 3付款方式 4 帮助中心 5常见问题
        
        //items_news.Add(new Item("购物指南", "./images/clearing/9_dian.jpg", "shop/Article_Manager.aspx?Type=GWZN"));
        //items_news.Add(new Item("付款方式", "./images/clearing/9_dian.jpg", "shop/Article_Manager.aspx?Type=FKFS"));
        //items_news.Add(new Item("帮助中心", "./images/clearing/9_dian.jpg", "shop/Article_Manager.aspx?Type=BZZX"));
        //items_news.Add(new Item("常见问题", "./images/clearing/9_dian.jpg", "shop/Article_Manager.aspx?Type=CJWT"));


        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();

        group_g.Enabled = false;
    }

    private void SiteChildItem()
    {
        lbModelName.Text = "代理专区"; //模块名称   

        lbMain.Groups.Clear();

        Group group_hygl = new Group("新网店注册", "g_hygl");
        setGroupStyle(group_hygl);
        lbMain.Groups.Add(group_hygl);
        Items items_hygl = lbMain.Groups.FromKey("g_hygl").Items;
        items_hygl.Clear();

        items_hygl.Add(new Item("会员注册报单", "./images/clearing/9_dian.jpg", "BalanceCenter/Buy.aspx"));
        items_hygl.Add(new Item("待激活会员", "./images/clearing/9_dian.jpg", "BalanceCenter/ActivationUserList.aspx"));
        items_hygl.Add(new Item("已激活会员", "./images/clearing/9_dian.jpg", "BalanceCenter/ActivationList.aspx"));  


        Group group_zxgl = new Group("服务中心公告", "g_zxgl");
        setGroupStyle(group_zxgl);
        lbMain.Groups.Add(group_zxgl);
        Items items_zxgl = lbMain.Groups.FromKey("g_zxgl").Items;
        items_zxgl.Clear();

        items_zxgl.Add(new Item("服务中心公告", "./images/clearing/9_dian.jpg", "BalanceCenter/ServiceNotice.aspx"));        


        Group group_spgl = new Group("注册记录明细", "g_spgl");
        setGroupStyle(group_spgl);
        lbMain.Groups.Add(group_spgl);
        Items items_spgl = lbMain.Groups.FromKey("g_spgl").Items;
        items_spgl.Clear();

        items_spgl.Add(new Item("我的电子货币", "./images/clearing/9_dian.jpg", "BalanceCenter/ScoreEarning2.aspx"));
        items_spgl.Add(new Item("报单记录", "./images/clearing/9_dian.jpg", "BalanceCenter/ScoreEarning.aspx"));
     

        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();

        group_g.Enabled = false;
    }

    private void setGroupStyle(Group group)
    {
        group.Expanded = false;
        group.TextAlign = "left";
        group.ItemAlign = "left";
        group.ImageTextAlign = ImageTextAlign.Middle;
    }

}